package com.acwing.partition3;

import java.io.*;
import java.util.*;

/**
 * @author `RKC`
 * @date 2022/2/27 15:01
 */
public class AC247亚特兰蒂斯 {

    private static final int N = 10010;
    private static final double eps = 1e-5;
    private static Set<Double> set = new TreeSet<>();
    private static Map<Integer, Double> map1 = new HashMap<>();
    private static Map<Double, Integer> map2 = new HashMap<>();

    private static Node[] tr = new Node[N << 3];
    private static Segment[] seg = new Segment[N << 1];
    private static int n, m, id;

    private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    private static final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        int t = 1;
        while (true) {
            n = Integer.parseInt(reader.readLine());
            if (n == 0) break;
            for (int i = 0; i < n; i++) {
                String[] ss = reader.readLine().split(" ");
                double x1 = Double.parseDouble(ss[0]), y1 = Double.parseDouble(ss[1]), x2 = Double.parseDouble(ss[2]), y2 = Double.parseDouble(ss[3]);
                seg[m++] = new Segment(x1, y1, y2, 1);
                seg[m++] = new Segment(x2, y1, y2, -1);
                set.add(y1);
                set.add(y2);
                set.add(y2 - eps);
            }
            //离散化
            for (double y : set) {
                map1.put(++id, y);
                map2.put(y, id);
            }
            Arrays.sort(seg, 0, m);
            build(1, 0, set.size());
            double ans = 0;
            for (int i = 0; i < m; i++) {
                if (i > 0) ans += tr[1].len * (seg[i].x - seg[i - 1].x);
                modify(1, map2.get(seg[i].y1), map2.get(seg[i].y2 - eps), seg[i].k);
            }
            writer.write(String.format("Test case #%d\nTotal explored area: %.2f\n\n", t++, ans));
            reset();
        }
        writer.flush();
    }

    private static void modify(int u, int l, int r, int k) {
        if (l <= tr[u].l && r >= tr[u].r) {
            tr[u].cnt += k;
        } else {
            int mid = tr[u].l + tr[u].r >> 1;
            if (l <= mid) modify(u << 1, l, r, k);
            if (r > mid) modify(u << 1 | 1, l, r, k);
        }
        pushup(u);
    }

    private static void build(int u, int l, int r) {
        tr[u] = new Node(l, r);
        if (l != r) {
            int mid = l + r >> 1;
            build(u << 1, l, mid);
            build(u << 1 | 1, mid + 1, r);
            pushup(u);
        }
    }

    private static void pushup(int u) {
        if (tr[u].cnt > 0) tr[u].len = map1.get(tr[u].r + 1) - map1.get(tr[u].l);
        else if (tr[u].l == tr[u].r) tr[u].len = 0;
        else tr[u].len = tr[u << 1].len + tr[u << 1 | 1].len;
    }

    private static void reset() {
        n = m = id = 0;
        set.clear();
        map1.clear();
        map2.clear();
    }

    private static class Segment implements Comparable<Segment> {
        private double x, y1, y2;
        private int k;

        public Segment(double x, double y1, double y2, int k) {
            this.x = x;
            this.y1 = y1;
            this.y2 = y2;
            this.k = k;
        }

        @Override
        public int compareTo(Segment o) {
            return Double.compare(x, o.x);
        }
    }

    private static class Node {
        private int l, r, cnt;
        private double len;

        public Node(int l, int r) {
            this.l = l;
            this.r = r;
        }
    }
}
